home *** CD-ROM | disk | FTP | other *** search
- PolyGone is a VB app with no redeeming value... it's just
- fun to have it on the desktop. All it does is draw polygons
- with connected vertices in various sizes and colors. It tracks
- the size of the form it's on, and adjusts the size and maximum
- number of vertices (the "order" of the polygon) accordingly.
- It's very easy on resources, and it's even fun when minimized!
-
- The basic polygon drawing routine has been around for
- several (at least 15) years, and I can't properly credit the
- original source. I modified it enough that it hardly matters.
-
- All of the real action takes place in the routine "Outer",
- which loops choosing a current color, H and V offset, overall
- size and polygon order. These are chosen by using scaled random
- numbers so that the results are reasonable given the current
- window size and shape. The routine will occasionally "wipe out"
- the accumulated images on its own by drawing a large and dense
- polygon in the background color and then clearing the window.
- You can force the window to clear after the current polygon is
- drawn by clicking anywhere in the window.
-
- The grunt work takes place in the routine DrawPoly, which
- does what its name implies. The code is a horrible mishmash of
- local and global variables, etc, but it's so simple it didn't
- warrant any more elaboration.
-
- The routine "ReScale" is invoked in the Load and Resize
- event procedures, and makes some arbitrary decisions about how
- large the polygons should get (they're ranged when drawn), and
- what the maximum vertex count should be... too many vertices and
- the polygons all look like solid circles and take very long to
- draw; too few and they're difficult to distinguish.
-
- I converted this from a QB version in about 10 minutes, to
- show my son how easily some things can be ported to VB, and it
- just worked. Putting the VB-specific code in place took another
- hour or so, and then a couple days of just watching it perform
- off to the side and tweaking the internal "factors".
-
- This program isn't copyrighted........ feel free to adapt
- it as you see fit. I'd appreciate it if you'd send me a copy of
- anything you produce with this as a starting point. Enjoy!
-
-
- -- Jim Mack
- CIS 76630,2012
- Editing Services Co
- PO Box 599
- Plymouth, MI 48170
-